#!/usr/bin/python
# -*- encoding: utf-8 -*-
'''
@File    :   3server.py
@Time    :   2020/06/25 02:29:23
@Author  :   Malygos_l 
@Version :   1.0
@Contact :   751756061@qq.com
@WebSite :   www.gitee.com/malygos_l
'''
# Start typing your code from here
'''
udp
'''

from socket import *

#ip
ADDR = ('127.0.0.1',8888)

#创建连接
server = socket(AF_INET,SOCK_DGRAM)

#绑定
server.bind(ADDR)

print("服务器已经启动")

setdefaulttimeout(20)

while True:    
    data,client = server.recvfrom(1024)    
    print("接受客户端的消息:",data.decode("utf-8"))    
    info = input('>>>')    
    server.sendto(info.encode(),client) 

server.close()